<?php /* Smarty version 2.6.26, created on 2011-02-16 17:21:41
         compiled from admin/customer.html */ ?>
<?php require_once(SMARTY_CORE_DIR . 'core.load_plugins.php');
smarty_core_load_plugins(array('plugins' => array(array('function', 'html_select_time', 'admin/customer.html', 951, false),array('modifier', 'sslash', 'admin/customer.html', 1119, false),array('modifier', 'escape', 'admin/customer.html', 1119, false),array('modifier', 'date_format', 'admin/customer.html', 1126, false),)), $this); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
<html xmlns="http://www.w3.org/1999/xhtml" lang="ru" xml:lang="ru"> 
    <head>
	<title>LocalCRM</title>
	<script src="js/jquery-1.4.2.min.js" type="text/javascript"></script>
	<script src="js/jquery-ui-1.8.4.custom.min.js" type="text/javascript"></script>
	<script src="js/jquery.blockUI.js" type="text/javascript"></script>
	<script src="js/jquery.contextMenu.js" type="text/javascript"></script>

	<script src="js/i18n/grid.locale-ru.js" type="text/javascript"></script>
	<script src="js/jquery.jqGrid.min.js" type="text/javascript"></script>
	<link href="css/ui.jqgrid.css" rel="stylesheet" type="text/css"/>

	<script src="js/crm/common.js" type="text/javascript"></script>
	<link href="css/redmond/jquery-ui-1.8.4.custom.css" rel="stylesheet" type="text/css"/>
	<link href="css/jquery.contextMenu.css" rel="stylesheet" type="text/css"/>
    </head>
    <body>
	<script type="text/javascript">
	<!--
	<?php echo '
	$(document).ready
	(
	    function()
	    {
		$(\'#match-jur\').click
		(
		    function()
		    {
			if ( $(this).attr(\'checked\') )
			{
			    $(\'#actual-region\').val( $(\'#legal-region\').val() );
			    $(\'#actual-city\').val( $(\'#legal-city\').val() );
			    $(\'#actual-index\').val( $(\'#legal-index\').val() );
			    $(\'#actual-street\').val( $(\'#legal-street\').val() );
			    $(\'#actual-home\').val( $(\'#legal-home\').val() );
			    $(\'#actual-litera\').val( $(\'#legal-litera\').val() );
			    $(\'#actual-office\').val( $(\'#legal-office\').val() );

			    $(\'.address-actual\').hide();
			}
			else
			{
			    $(\'.address-actual\')
				.val(\'\')
				.show();
			}
		    }
		);

		$(\'#match\').click
		(
		    function()
		    {
			if ( $(this).attr(\'checked\') )
			{
			    $(\'#postal-match\')
				.fadeIn(\'fast\')
				.focus();
			}
			else
			{
			    $(\'#postal-match\').fadeOut(\'fast\');
			    $(\'.address-postal:hidden\').show();
			}
		    }
		);

		$(\'#postal-match\').change
		(
		    function()
		    {
			if ( $(\'#match\').attr(\'checked\') )
			{
			    switch($(this).val())
			    {
				case	\'jur\':
				    $(\'#postal-region\').val( $(\'#legal-region\').val() );
				    $(\'#postal-city\').val( $(\'#legal-city\').val() );
				    $(\'#postal-index\').val( $(\'#legal-index\').val() );
				    $(\'#postal-street\').val( $(\'#legal-street\').val() );
				    $(\'#postal-home\').val( $(\'#legal-home\').val() );
				    $(\'#postal-litera\').val( $(\'#legal-litera\').val() );
				    $(\'#postal-office\').val( $(\'#legal-office\').val() );
				    $(\'.address-postal\').hide();
				    break;

				case	\'act\':
				    $(\'#postal-region\').val( $(\'#actual-region\').val() );
				    $(\'#postal-city\').val( $(\'#actual-city\').val() );
				    $(\'#postal-index\').val( $(\'#actual-index\').val() );
				    $(\'#postal-street\').val( $(\'#actual-street\').val() );
				    $(\'#postal-home\').val( $(\'#actual-home\').val() );
				    $(\'#postal-litera\').val( $(\'#actual-litera\').val() );
				    $(\'#postal-office\').val( $(\'#actual-office\').val() );
				    $(\'.address-postal\').hide();
				    break;

				case	\'0\':
				    $(\'#match\').attr(\'checked\',false);
				    $(this).fadeOut(\'fast\');
				    $(\'.address-postal\')
					.val(\'\')
					.show();
			    }
			}
		    }
		);

		$(\'input:button#clear\').click(function(){$(\'input:text\').val(\'\')});
		$(\'input:button#save\').click
		(
		    function()
		    {
			$(\'form#main\').submit();
		    }
		);

		$(\'input[id$=region]\').autocomplete
		({
		    source:	\'json/getDictionary.php?dictionary=regions\',
		    delay:	0
		});

		$(\'input[id$=city]\').autocomplete
		({
		    source:	\'json/getDictionary.php?dictionary=cities\',
		    delay:	0
		});

		$(\'input[id$=street]\').autocomplete
		({
		    source:	\'json/getDictionary.php?dictionary=streets\',
		    delay:	0
		});

		$(\'input#contact-post\').autocomplete
		({
		    source:	\'json/getDictionary.php?dictionary=posts\',
		    delay:	0
		});

		$(\'a#manage-managers\').click
		(
		    function()
		    {
			refreshManagers();
			$(\'div#managers\')
			    .dialog(\'option\',\'title\',\'Менеджеры\')
			    .dialog(\'option\',\'resizable\',false)
			    .dialog(\'option\',\'width\',750)
			    .dialog(\'open\');
		    }
		);

		$(\'a#manage-groups\').click
		(
		    function()
		    {
			refreshGroups();
			$(\'div#groups\')
			    .dialog(\'option\',\'title\',\'Управление группами\')
			    .dialog(\'option\',\'resizable\',false)
			    .dialog(\'option\',\'width\',320)
			    .dialog(\'open\');
		    }
		);

		$(\'a#manage-statuses\').click
		(
		    function()
		    {
			refreshStatuses();
			$(\'div#statuses\')
			    .dialog(\'option\',\'title\',\'Управление статусами\')
			    .dialog(\'option\',\'resizable\',false)
			    .dialog(\'option\',\'width\',320)
			    .dialog(\'open\');
		    }
		);

		$(\'a#manager-add\').click
		(
		    function()
		    {
			var tbody = $(\'div#managers\').find(\'tbody\');
			var last_num = tbody.children(\':last\').children().html();
			var link = $(this);
			tbody
			    .append
			    (
				\'<tr>\'
				    +\'<td>\'+(parseFloat(last_num)+1)+\'</td>\'
				    +\'<td><input type="text" id="manager-name"/></td>\'
				    +\'<td><input type="text" id="manager-login"/></td>\'
				    +\'<td><input type="text" id="manager-password"/>&nbsp;<a href="javascript:void(0)" id="manager-password-generate"><img src="images/icons/key_16.png" border="0" title="Сгенерировать пароль"/></a></td>\'
				    +\'<td align="center"><input type="checkbox" id="manager-admin"/></td>\'
				    +\'<td align="center"><a href="javascript:void(0)" id="manager-save"><img src="images/icons/tick_16.png" border="0"/></a></td>\'
				+\'</tr>\'
			    )
			    .find(\'a#manager-save\')
				.click
				(
				    function()
				    {
					$.ajax
					({
					    cache:	false,
					    url:	\'json/manager.php\',
					    type:	\'POST\',
					    dataType:	\'json\',
					    data:
					    {
						action:	\'add\',
						manager_name:	$(\'input#manager-name\').val(),
						login:		$(\'input#manager-login\').val(),
						password:	$(\'input#manager-password\').val(),
						int_num:	$(\'input#manager-int-num\').val(),
						is_admin:	$(\'input#manager-admin\').attr(\'checked\')?1:0,
					    },
					    success:	function(json)
					    {
						switch(json[\'code\'])
						{
						    case	200:
							refreshManagers();
							link.fadeIn();
							break;
						    default:
							alert(json[\'text\']);
						}
					    }
					});
				    }
				)
				.end()
			    .find(\'a#manager-password-generate\')
				.click
				(
				    function()
				    {
					$.getJSON(\'json/getRandomPassword.php\',function(json){$(\'#manager-password\').val(json[\'pw\']);});
				    }
				);

			$(this).fadeOut();
		    }
		);

		$(\'a#password-generate\').click(function(){$.getJSON(\'json/getRandomPassword.php\',function(json){$(\'input#email-password\').val(json[\'pw\']);});});

		function refreshManagers()
		{
		    $.getJSON
		    (
			\'json/getDictionary.php\',
			{ dictionary: \'managers\' },
			function(json)
			{
			    var select= $(\'select#manager-select\');
			    var tbody = $(\'div#managers\').find(\'tbody\');
			    tbody.find(\'tr\').remove();
			    select.find(\'option\').remove();

			    for(i=0;i<json.length;i++)
			    {
				select
				    .append(\'<option value="\'+json[i][\'id\']+\'">\'+json[i][\'manager_name\']+\'</option>\')
				    .find(\'option[value=\'+json[i][\'id\']+\']\')
					.attr(\'selected\',json[i][\'id\']=='; ?>
<?php echo $this->_tpl_vars['session']['manager']['id']; ?>
<?php echo '?true:false);

				tbody
				    .append
				    (
					\'<tr id="manager_\'+json[i][\'id\']+\'">\'
					    +\'<td>\'+(i+1)+\'</td>\'
					    +\'<td>\'+json[i][\'manager_name\']+\'</td>\'
					    +\'<td>\'+json[i][\'login\']+\'</td>\'
					    +\'<td>\'+json[i][\'password\']+\'</td>\'
					    +\'<td align="center"><input type="checkbox" class="manager-is-admin"/></td>\'
					    +\'<td>\'+json[i][\'internal_number\']+\'</td>\'
					    +\'<td align="center"><a href="javascript:void(0)" class="manager-delete"><img src="images/icons/delete_16.png" border="0" title="Удалить"/></a></td>\'
					+\'</tr>\'
				    )
				    .find(\'tr#manager_\'+json[i][\'id\'])
					.find(\'input:checkbox.manager-is-admin\')
					    .attr(\'checked\',json[i][\'is_admin\']==\'1\'?true:false)
					    .click
					    (
						function()
						{
						    var manager_id = $(this).parent().parent().attr(\'id\');
						    $.ajax
						    ({
							cache:	false,
							url:	\'json/manager.php\',
							type:	\'POST\',
							dataType:	\'json\',
							data:
							{
							    action:	\'update\',
							    is_admin:	$(this).attr(\'checked\')?1:0,
							    id:	manager_id
							},
							success:	function(json)
							{
							    switch(json[\'code\'])
							    {
								case	200:
								    refreshManagers();
								    break;
								default:
								    alert(json[\'text\']);
							    }
							}
						    });
						}
					    )
					    .end()
					.find(\'a.manager-delete\')
					    .click
					    (
						function()
						{
						    var manager_id = $(this).parent().parent().attr(\'id\');
						    $.ajax
						    ({
							cache:	false,
							url:	\'json/manager.php\',
							type:	\'POST\',
							dataType:	\'json\',
							data:
							{
							    action:	\'delete\',
							    id:	manager_id
							},
							success:	function(json)
							{
							    switch(json[\'code\'])
							    {
								case	200:
								    refreshManagers();
								    break;
								default:
								    alert(json[\'text\']);
							    }
							}
						    });
						}
					    )
					    .end();
			    }
			}
		    )
		}

		$(\'a#group-add\').click
		(
		    function()
		    {
			var tbody = $(\'div#groups\').find(\'tbody\');
			var last_num = tbody.children(\':last\').children().html();
			var link = $(this);
			tbody
			    .append
			    (
				\'<tr>\'
				    +\'<td>\'+(parseFloat(last_num)+1)+\'</td>\'
				    +\'<td><input type="text" id="group-name"/></td>\'
				    +\'<td align="center"><a href="javascript:void(0)" id="group-save"><img src="images/icons/tick_16.png" border="0"/></a></td>\'
				+\'</tr>\'
			    )
			    .find(\'a#group-save\')
				.click
				(
				    function()
				    {
					$.getJSON
					(
					    \'json/updateDictionary.php\',
					    {
						dictionary:	\'groups\',
						action:		\'add\',
						name:		$(\'input#group-name\').val()
					    },
					    function(json)
					    {
						switch(json[\'code\'])
						{
						    case	200:
							refreshGroups();
							link.fadeIn();
							break;
						    default:
							alert(json[\'text\']);
						}
					    }
					);
				    }
				);
			$(this).fadeOut();
		    }
		);

		function refreshGroups()
		{
		    $.getJSON
		    (
			\'json/getDictionary.php\',
			{ dictionary: \'groups\' },
			function(json)
			{
			    var select= $(\'select#select-group\');
			    var tbody = $(\'div#groups\').find(\'tbody\');
			    tbody.find(\'tr\').remove();
			    select.find(\'option\').remove();

			    for(i=0;i<json.length;i++)
			    {
				select
				    .append(\'<option value="\'+json[i][\'id\']+\'">\'+json[i][\'group_name\']+\'</option>\');

				tbody
				    .append
				    (
					\'<tr id="group_\'+json[i][\'id\']+\'">\'
					    +\'<td>\'+(i+1)+\'</td>\'
					    +\'<td>\'+json[i][\'group_name\']+\'</td>\'
					    +\'<td align="center"><a href="javascript:void(0)" class="group-delete"><img src="images/icons/delete_16.png" border="0" title="Удалить"/></a></td>\'
					+\'</tr>\'
				    )
				    .find(\'tr#group_\'+json[i][\'id\'])
					.find(\'a.group-delete\')
					    .click
					    (
						function()
						{
						    var id = $(this).parent().parent().attr(\'id\');
						    $.getJSON
						    (
							\'json/updateDictionary.php\',
							{
							    dictionary:	\'groups\',
							    action:	\'delete\',
							    id:		id
							},
							function(json)
							{
							    switch(json[\'code\'])
							    {
								case	200:
								    refreshGroups();
								    break;
								default:
								    alert(json[\'text\']);
							    }
							}
						    );
						}
					    )
					    .end();
			    }
			}
		    )
		}

		$(\'a#status-add\').click
		(
		    function()
		    {
			var tbody = $(\'div#statuses\').find(\'tbody\');
			var last_num = tbody.children(\':last\').children().html();
			var link = $(this);
			tbody
			    .append
			    (
				\'<tr>\'
				    +\'<td>\'+(parseFloat(last_num)+1)+\'</td>\'
				    +\'<td><input type="text" id="status-name"/></td>\'
				    +\'<td align="center"><a href="javascript:void(0)" id="status-save"><img src="images/icons/tick_16.png" border="0"/></a></td>\'
				+\'</tr>\'
			    )
			    .find(\'a#status-save\')
				.click
				(
				    function()
				    {
					$.getJSON
					(
					    \'json/updateDictionary.php\',
					    {
						dictionary:	\'statuses\',
						action:		\'add\',
						name:		$(\'input#status-name\').val()
					    },
					    function(json)
					    {
						switch(json[\'code\'])
						{
						    case	200:
							refreshStatuses();
							link.fadeIn();
							break;
						    default:
							alert(json[\'text\']);
						}
					    }
					);
				    }
				);
			$(this).fadeOut();
		    }
		);

		function refreshStatuses()
		{
		    $.getJSON
		    (
			\'json/getDictionary.php\',
			{ dictionary: \'statuses\' },
			function(json)
			{
			    var select= $(\'select#select-status\');
			    var tbody = $(\'div#statuses\').find(\'tbody\');
			    tbody.find(\'tr\').remove();
			    select.find(\'option\').remove();

			    for(i=0;i<json.length;i++)
			    {
				select
				    .append(\'<option value="\'+json[i][\'id\']+\'">\'+json[i][\'status_name\']+\'</option>\');

				tbody
				    .append
				    (
					\'<tr id="status_\'+json[i][\'id\']+\'">\'
					    +\'<td>\'+(i+1)+\'</td>\'
					    +\'<td>\'+json[i][\'status_name\']+\'</td>\'
					    +\'<td align="center"><a href="javascript:void(0)" class="status-delete"><img src="images/icons/delete_16.png" border="0" title="Удалить"/></a></td>\'
					+\'</tr>\'
				    )
				    .find(\'tr#status_\'+json[i][\'id\'])
					.find(\'a.status-delete\')
					    .click
					    (
						function()
						{
						    var id = $(this).parent().parent().attr(\'id\');
						    $.getJSON
						    (
							\'json/updateDictionary.php\',
							{
							    dictionary:	\'statuses\',
							    action:	\'delete\',
							    id:		id
							},
							function(json)
							{
							    switch(json[\'code\'])
							    {
								case	200:
								    refreshStatuses();
								    break;
								default:
								    alert(json[\'text\']);
							    }
							}
						    );
						}
					    );
			    }
			}
		    )
		}

		$(\'tr.task-row\')
		    .css(\'cursor\',\'pointer\')
		    .hover
		    (
			function(){$(this).addClass(\'ui-state-hover\');},
			function(){$(this).removeClass(\'ui-state-hover\');}
		    )
		    .click(function(){showTask($(this).children().children().html());});

		$(\'a.contact-delete\').click
		(
		    function()
		    {
			if ( !window.confirm(\'Вы уверены?\') )
			{
			    return false;
			}
		    }
		);

		$(\'a#treatment-add\').click
		(
		    function()
		    {
			$(\'div#treatment\')
			    .dialog(\'option\',\'title\',\'Добавить обращение\')
			    .dialog(\'option\',\'width\',700)
			    .dialog(\'option\',\'resizable\',false)
			    .dialog(\'option\',\'buttons\',{\'Сохранить\':function(){$(this).find(\'form\').submit();}})
			    .dialog(\'open\');
		    }
		);

		$(\'a#contact-add\').click
		(
		    function()
		    {
			$(\'div#contact\')
			    .dialog(\'option\',\'title\',\'Добавить контакт\')
			    .dialog(\'option\',\'width\',480)
			    .dialog(\'option\',\'resizable\',false)
			    .dialog(\'option\',\'buttons\',{\'Сохранить\':function(){$(this).find(\'form\').submit();}})
			    .dialog(\'open\');
		    }
		);

		$(\'a#contract-add\').click
		(
		    function()
		    {
			var new_row = $(\'tr.contract-row:last\')
			    .clone()
			    .find(\'input\')
				.val(\'\')
				.end();

			$(\'tr.contract-row:last\').after(new_row);
		    }
		);

		$(\'a#arbitrary-add\').click
		(
		    function()
		    {
			var new_row = $(\'tr.arbitrary-row:last\')
			    .clone()
			    .find(\'input\')
				.val(\'\')
				.end();

			$(\'tr.arbitrary-row:last\').after(new_row);
		    }
		);

		$(\'#document-add\').click
		(
		    function()
		    {
			$(\'div#docs\')
			    .dialog(\'option\',\'title\',\'Добавить документы\')
			    .dialog(\'option\',\'width\',\'auto\')
			    .dialog(\'option\',\'resizable\',false)
			    .dialog(\'option\',\'buttons\',{\'Загрузить\':function(){$(this).find(\'form\').submit();}})
			    .dialog(\'open\');
		    }
		);

		$(\'#document-add-invoice\').click
		(
		    function()
		    {
			$(\'div#docs-invoice\')
			    .dialog(\'option\',\'title\',\'Добавить документы\')
			    .dialog(\'option\',\'width\',\'auto\')
			    .dialog(\'option\',\'resizable\',false)
			    .dialog(\'option\',\'buttons\',{\'Загрузить\':function(){$(this).find(\'form\').submit();}})
			    .dialog(\'open\');
		    }
		);

		$(\'#document-append\').click
		(
		    function()
		    {
			$(\'div#docs\')
			    .find(\'tbody\')
				.find(\'tr:last\')
				.clone()
				.find(\'input\')
				    .val(\'\')
				    .end()
				.appendTo($(\'div#docs\').find(\'tbody\'));
		    }
		);

		$(\'#document-append-invoice\').click
		(
		    function()
		    {
			$(\'div#docs-invoice\')
			    .find(\'tbody\')
				.find(\'tr:last\')
				.clone()
				.find(\'input\')
				    .val(\'\')
				    .end()
				.appendTo($(\'div#docs-invoice\').find(\'tbody\'));
		    }
		);

		$(\'a#act-print-rtk\').click
		(
		    function()
		    {
			window.open(\'doc-print.php?type=akt&provider=rtk&account_id='; ?>
<?php echo $this->_tpl_vars['customer']['account_id']; ?>
<?php echo '\',\'DOC\');
		    }
		);

		$(\'a#act-print-inline\').click
		(
		    function()
		    {
			window.open(\'doc-print.php?type=akt&provider=inline&account_id='; ?>
<?php echo $this->_tpl_vars['customer']['account_id']; ?>
<?php echo '\',\'DOC\');
		    }
		);

		$(\'a#invoice-print-rtk\').click
		(
		    function()
		    {
			window.open(\'doc-print.php?type=invoice&provider=rtk&account_id='; ?>
<?php echo $this->_tpl_vars['customer']['account_id']; ?>
<?php echo '\',\'DOC\');
		    }
		);

		$(\'a#invoice-print-inline\').click
		(
		    function()
		    {
			window.open(\'doc-print.php?type=invoice&provider=inline&account_id='; ?>
<?php echo $this->_tpl_vars['customer']['account_id']; ?>
<?php echo '\',\'DOC\');
		    }
		);

		$(\'#task\').click
		(
		    function()
		    {
			if ( $(this).attr(\'checked\') )
			{
			    $(\'tr.task-prop\').show();
			}
			else
			{
			    $(\'tr.task-prop\').hide();
			}
		    }
		);

		$(\'div.dialog#context\')
		    .dialog
		    (
			\'option\',
			{
			    title:	\'Редактирование\',
			    width:	640,
			    resizable:	false
			}
		    );

		$(\'tr.data-row\')
		    .css(\'cursor\',\'default\')
		    .contextMenu
		    (
			{ menu:	\'contextMenu-common\' },
			function(action,el,pos)
			{
			    var class = $(el)
					    .parentsUntil(\'table\')
					    .parent()
					    .attr(\'id\');

			    var obj_id= $(el)
					    .children()
					    .children()
					    .html();

			    switch(action)
			    {
				case	\'edit\':
				    $.get(class+\'.php\',{id:$(el).children().children().html()},function(data){$(\'div#context\').html(data);});
				    $(\'div#context\')
					.text(\'Загрузка...\')
					.dialog(\'open\');
				    break;

				case	\'delete\':
				    if ( window.confirm(\'Вы уверены?\') )
				    {
					window.location = class+\'-delete.php?id=\'+obj_id;
				    }
				    break;
			    }
			}
		    );

		$(\'div.ui-state-disabled\')
		    .find(\'input:text,input:submit,select\')
			.attr(\'disabled\',true);

		$(\'input:checkbox.set-period\').click
		(
		    function()
		    {
			if ( $(this).attr(\'checked\') )
			{
			    $(\'div.div-set-period\')
				.addClass(\'ui-state-default\')
				.removeClass(\'ui-state-disabled\')
				.find(\'input,select\')
				    .attr(\'disabled\',false);
			}
			else
			{
			    $(\'div.div-set-period\')
				.addClass(\'ui-state-disabled\')
				.removeClass(\'ui-state-default\')
				.find(\'input:text,input:submit,select\')
				    .attr(\'disabled\',true)
				    .end()
				.find(\'form\')
				    .submit();
			}
		    }
		);
	    }
	);
	'; ?>

	-->
	</script>

<!-- НАЧАЛО контекстного меню -->
	<ul id="contextMenu-common" class="ui-widget" style="display: none;">
	    <li class="edit"><a href="#edit">Изменить</a></li>
	    <li class="delete"><a href="#delete">Удалить</a></li>
	</ul>
<!-- КОНЕЦ контекстного меню -->

	<div class="dialog" id="context"></div>

<!--
/*
#    НАЧАЛО БЛОКА ВСПЛЫВАЮЩИХ ОКОН
*/
-->

<!-- Инфо о задаче -->
	<div id="task-info" class="dialog">
	    <table width="100%" class="ui-widget ui-state-default" cellspacing="0">
		<thead>
		    <tr>
			<td align="right"><strong>Постановщик:</strong></td>
			<td></td>
			<td align="right"><strong>Дата постановки:</strong></td>
			<td></td>
		    </tr>
		    <tr>
			<td align="right"><strong>Ответственный:</strong></td>
			<td></td>
			<td align="right"><strong>Приступить к выполнению:</strong></td>
			<td></td>
		    </tr>
		</thead>
		<tbody>
		</tbody>
	    </table>
	</div>

<!-- Список сотрудников -->
	<div class="dialog" id="managers">
	    <table width="100%" class="ui-widget" cellspacing="0" rules="all" style="border: solid 1px #000000;">
		<thead class="ui-widget-header">
		    <tr>
			<th>#</th>
			<th>Имя</th>
			<th>Логин</th>
			<th>Пароль</th>
			<th>Админ</th>
			<th>Внутр. номер</th>
			<th>&nbsp;</th>
		    </tr>
		</thead>
		<tbody class="ui-widget-content">
		</tbody>
	    </table>
	    <br/>
	    <a href="javascript:void(0)" id="manager-add"><img src="images/icons/plus_16.png" border="0"/>&nbsp;Добавить менеджера</a>
	</div>

<!-- Список групп -->
	<div class="dialog" id="groups">
	    <table width="100%" class="ui-widget" cellspacing="0" rules="all" style="border: solid 1px #000000;">
		<thead class="ui-widget-header">
		    <tr>
			<th>#</th>
			<th>Имя</th>
			<th>&nbsp;</th>
		    </tr>
		</thead>
		<tbody class="ui-widget-content">
		</tbody>
	    </table>
	    <br/>
	    <a href="javascript:void(0)" id="group-add"><img src="images/icons/plus_16.png" border="0"/>&nbsp;Добавить группу</a>
	</div>

<!-- Список статусов -->
	<div class="dialog" id="statuses">
	    <table width="100%" class="ui-widget" cellspacing="0" rules="all" style="border: solid 1px #000000;">
		<thead class="ui-widget-header">
		    <tr>
			<th>#</th>
			<th>Имя</th>
			<th>&nbsp;</th>
		    </tr>
		</thead>
		<tbody class="ui-widget-content">
		</tbody>
	    </table>
	    <br/>
	    <a href="javascript:void(0)" id="status-add"><img src="images/icons/plus_16.png" border="0"/>&nbsp;Добавить статус</a>
	</div>

	<?php if ($this->_tpl_vars['customer'] != ''): ?>
<!-- Добавление обращений -->
	<div class="dialog" id="treatment">
	    <form action="db.php" method="post">
	    <input type="hidden" name="action" value="treatment.new.do"/>
	    <input type="hidden" name="account_id" value="<?php echo $this->_tpl_vars['customer']['account_id']; ?>
"/>
	    <table class="ui-widget" cellspacing="0" width="100%">
		<tr>
		    <td align="right">Тип:</td>
		    <td>
			<select name="direction">
			    <option value="incomming">Входящее</option>
			    <option value="outgoing">Исходящее</option>
			</select>
		    </td>
		    <td colspan="2">
			<input type="checkbox" name="task" id="task"/>
			<label for="task" style="corsor: pointer;">Задача</label>
		    </td>
		</tr>
		<tr>
		    <td align="right">Дата:</td>
		    <td><input type="text" name="treatment_date" class="date"/></td>
		    <td align="right">Время:</td>
		    <td><?php echo smarty_function_html_select_time(array('display_seconds' => false), $this);?>
</td>
		</tr>
		<tr>
		    <td align="right" valign="top">Примечание:</td>
		    <td colspan="3"><textarea name="note" style="width: 100%;"></textarea></td>
		</tr>
		<tr>
		</tr>
		<tr class="task-prop" style="display: none;">
		    <td align="right">Приступить:</td>
		    <td><input type="text" name="start_date" class="date"/>&nbsp;<?php echo smarty_function_html_select_time(array('prefix' => 'start_','display_seconds' => false,'minute_interval' => 10), $this);?>
</td>
		    <td align="right">Ответственный:</td>
		    <td>
			<select name="responsible_manager">
			<?php $_from = $this->_tpl_vars['managers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['manager']):
?>
			    <option value="<?php echo $this->_tpl_vars['manager']['id']; ?>
" <?php if ($this->_tpl_vars['session']['manager']['id'] == $this->_tpl_vars['manager']['id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['manager']['manager_name']; ?>
</option>
			<?php endforeach; endif; unset($_from); ?>
			</select>
		    </td>
		</tr>
	    </table>
	    </form>
	</div>

<!-- Добавление контакта -->
	<div class="dialog" id="contact">
	    <form action="db.php" method="post">
	    <input type="hidden" name="action" value="contact.new.do"/>
	    <input type="hidden" name="account_id" value="<?php echo $this->_tpl_vars['customer']['account_id']; ?>
"/>
	    <table class="ui-widget" cellspacing="0" width="100%">
		<tr>
		    <td align="right">ФИО:</td>
		    <td><input type="text" name="contact_name"/></td>
		</tr>
		<tr>
		    <td align="right">Должность:</td>
		    <td><input type="text" name="post" id="contact-post"/></td>
		</tr>
		<tr>
		    <td align="right">Телефон:</td>
		    <td><input type="text" name="phone_number"/></td>
		</tr>
		<tr>
		    <td align="right">E-Mail:</td>
		    <td><input type="text" name="email"/></td>
		</tr>
		<tr>
		    <td align="right" valign="top">Примечание:</td>
		    <td><textarea name="note"></textarea></td>
		</tr>
	    </table>
	    </form>
	</div>

<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/submodules/service_add.module.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>

<!-- Загрузка документа -->
	<div class="dialog" id="docs">
	    <form action="upload.php" method="post" enctype="multipart/form-data">
		<input type="hidden" name="account_id" value="<?php echo $this->_tpl_vars['customer']['account_id']; ?>
"/>
		<table width="98%" align="center">
		    <thead>
			<tr>
			    <th>Номер документа</th>
			    <th>Название документа</th>
			    <th>Дата</th>
			    <th>Файл</th>
			</tr>
		    </thead>
		    <tbody>
			<tr>
			    <td><input type="text" name="document_num[]"/></td>
			    <td><input type="text" name="document_name[]"/></td>
			    <td><input type="text" name="document_date[]" class="date"/></td>
			    <td><input type="file" name="document_file[]"/></td>
			</tr>
		    </tbody>
		</table>
		<a href="javascript:void(0)" id="document-append"><img src="images/icons/plus_16.png" border="0"/>&nbsp;Добавить файл</a>
	    </form>
	    <br/>
	    <small>* Примечание: Максимальный размер одного файла: <?php echo $this->_tpl_vars['upload_max_filesize']; ?>
</small>
	</div>

<!-- Загрузка счёта -->
	<div class="dialog" id="docs-invoice">
	    <form action="upload.php" method="post" enctype="multipart/form-data">
		<input type="hidden" name="account_id" value="<?php echo $this->_tpl_vars['customer']['account_id']; ?>
"/>
		<table width="98%" align="center">
		    <thead>
			<tr>
			    <th>Номер документа</th>
			    <th>Название документа</th>
			    <th>Дата</th>
			    <th>Тип</th>
			    <th>Файл</th>
			</tr>
		    </thead>
		    <tbody>
			<tr>
			    <td><input type="text" name="document_num[]"/></td>
			    <td><input type="text" name="document_name[]"/></td>
			    <td><input type="text" name="document_date[]" class="date"/></td>
			    <td>
				<select name="type[]">
				    <option value="inv_region">Регион Телеком</option>
				    <option value="inv_inlain">Инлайн</option>
				</select>
			    </td>
			    <td><input type="file" name="document_file[]"/></td>
			</tr>
		    </tbody>
		</table>
		<a href="javascript:void(0)" id="document-append-invoice"><img src="images/icons/plus_16.png" border="0"/>&nbsp;Добавить файл</a>
	    </form>
	    <br/>
	    <small>* Примечание: Максимальный размер одного файла: <?php echo $this->_tpl_vars['upload_max_filesize']; ?>
</small>
	</div>
	<?php endif; ?>

<!--
/*
#    НАЧАЛО HTML-ТЕЛА СТРАНИЦЫ
*/
-->
	<table width="100%">
	    <tr>
<!-- Левое навигационное меню -->
		<td width="15%" align="center" valign="top" style="padding: 1em;">
		    <a href="admin.php" class="button">Основное меню</a>
		    <hr/>
		    <a href="javascript:void(0)" class="button">Заявка на подключение</a>
		    <div style="margin-top: 300px;">
			<input type="button" class="button" id="save" value="Сохранить"/><br/>
			<input type="button" class="button" id="clear" value="Очистить"/><br/>
		    </div>
		</td>
		<td valign="top">
		    <?php if ($this->_tpl_vars['customer'] != ''): ?><input type="hidden" name="id" value="<?php echo $this->_tpl_vars['customer']['id']; ?>
"/><?php endif; ?>
<!--
/*
#    НАЧАЛО ВКЛАДОК
*/
-->
		    <div class="tabs">
<!-- Список (меню) вкладок -->
			<ul>
			    <li><a href="#info">Карточка</a></li>
			    <li><a href="#bank">Реквизиты</a></li>
			    <?php if ($this->_tpl_vars['customer'] != ''): ?>
			    <li><a href="#services">Услуги</a></li>
			    <li><a href="#contact">Контакты</a></li>
			    <?php endif; ?>
			    <?php if ($this->_tpl_vars['customer'] != ''): ?>
			    <li><a href="#document">Документы</a></li>
			    <li><a href="#invoice">Счета</a></li>
			    <?php endif; ?>
			</ul>
<!-- ВКЛАДКА Основная карточка -->
			<div id="info">
			    <form method="post" action="db.php" id="main">
			    <input type="hidden" name="action" value="<?php if ($this->_tpl_vars['customer'] != ''): ?>customer.edit.do<?php else: ?>customer.new.do<?php endif; ?>"/>
			    <?php if ($this->_tpl_vars['customer'] != ''): ?><input type="hidden" name="id" value="<?php echo $this->_tpl_vars['customer']['id']; ?>
"/><?php endif; ?>

			    <table align="center" class="ui-widget">
				<tr>
				    <td align="right">Клиент:</td>
				    <td colspan="3"><input type="text" name="name" value="<?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['customer']['customer_name'])) ? $this->_run_mod_handler('sslash', true, $_tmp) : stripslashes($_tmp)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
" style="width: 100%"/></td>
				</tr>
				<?php $_from = $this->_tpl_vars['contracts']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['contract']):
?>
				<tr class="contract-row">
				    <td align="right">Номер договора:</td>
				    <td><input type="text" name="contract_num_<?php echo $this->_tpl_vars['contract']['id']; ?>
" value="<?php echo $this->_tpl_vars['contract']['contract_number']; ?>
"/></td>
				    <td align="right">Дата заключения:</td>
				    <td><input type="text" name="date_contract_<?php echo $this->_tpl_vars['contract']['id']; ?>
" class="date" value="<?php echo ((is_array($_tmp=$this->_tpl_vars['contract']['accepted_date'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%Y-%m-%d') : smarty_modifier_date_format($_tmp, '%Y-%m-%d')); ?>
"/>&nbsp;<a href="contract-delete.php?id=<?php echo $this->_tpl_vars['contract']['id']; ?>
" class="contact-delete"><img src="images/icons/delete_16.png" border="0"/></a></td>
				</tr>
				<?php endforeach; endif; unset($_from); ?>
				<tr class="contract-row">
				    <td align="right">Номер договора:</td>
				    <td><input type="text" name="contract_num[]"/></td>
				    <td align="right">Дата заключения:</td>
				    <td><input type="text" name="date_contract[]" class="date"/></td>
				</tr>
				<tr><td colspan="4" align="right"><a href="javascript:void(0)" id="contract-add"><img src="images/icons/plus_16.png" border="0"/>Добавить договор</a></td></tr>
				<?php $_from = $this->_tpl_vars['arbitrary_fields']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['field']):
?>
				<tr class="arbitrary-row">
				    <td align="right"><?php echo $this->_tpl_vars['field']['field_name']; ?>
:</td>
				    <td><input type="text" name="arbitrary_field_<?php echo $this->_tpl_vars['field']['field_id']; ?>
" value="<?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['field']['value'])) ? $this->_run_mod_handler('sslash', true, $_tmp) : stripslashes($_tmp)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"/></td>
				    <td colspan="2"><a href="arbitrary-delete.php?id=<?php echo $this->_tpl_vars['field']['field_id']; ?>
"><img src="images/icons/delete_16.png" border="0"/></a></td>
				</tr>
				<?php endforeach; endif; unset($_from); ?>
				<tr class="arbitrary-row">
				    <td align="right">
					<select name="arb_field_name_id[]">
					<?php $_from = $this->_tpl_vars['customer_fields']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['field']):
?>
					    <?php if ($this->_tpl_vars['field']['id'] > 0): ?><option value="<?php echo $this->_tpl_vars['field']['id']; ?>
"><?php echo $this->_tpl_vars['field']['title']; ?>
</option><?php endif; ?>
					<?php endforeach; endif; unset($_from); ?>
					</select>
				    </td>
				    <td colspan="3"><input type="text" name="arbitrary_field[]"/></td>
				</tr>
				<tr><td colspan="4" align="right"><a href="javascript:void(0)" id="arbitrary-add"><img src="images/icons/plus_16.png" border="0"/>Добавить поле</a></td></tr>
				<?php if ($this->_tpl_vars['managers'] != ''): ?>
				<tr>
				    <td align="right">
					<a href="javascript:void(0)" id="manage-managers"><img src="images/icons/address_16.png" border="0"/></a>
					Менеджер:
				    </td>
				    <td colspan="3">
					<select name="manager" id="manager-select">
					<?php $_from = $this->_tpl_vars['managers']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['manager']):
?>
					    <?php if ($this->_tpl_vars['customer'] != ''): ?>
					    <option value="<?php echo $this->_tpl_vars['manager']['id']; ?>
" <?php if ($this->_tpl_vars['manager']['id'] == $this->_tpl_vars['customer']['manager_id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['manager']['manager_name']; ?>
</option>
					    <?php else: ?>
					    <option value="<?php echo $this->_tpl_vars['manager']['id']; ?>
" <?php if ($this->_tpl_vars['manager']['id'] == $this->_tpl_vars['session']['manager']['id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['manager']['manager_name']; ?>
</option>
					    <?php endif; ?>
					<?php endforeach; endif; unset($_from); ?>
					</select>
				    </td>
				</tr>
				<?php endif; ?>
				<tr>
				    <td align="right">E-Mail:</td>
				    <td><input type="text" name="email" value="<?php echo $this->_tpl_vars['customer']['email']; ?>
"/></td>
				    <td align="right">Пароль:</td>
				    <td>
					<input type="text" name="email_password" id="email-password" value="<?php echo $this->_tpl_vars['customer']['password']; ?>
"/>
					<a href="javascript:void(0)" id="password-generate"><img src="images/icons/key_16.png" border="0" title="Сгенерировать пароль"/></a>
				    </td>
				</tr>
				<tr><td colspan="4">&nbsp;</td></tr>
				<?php if ($this->_tpl_vars['groups'] != ''): ?>
				<tr>
				    <td align="right">
					<a href="javascript:void(0)" id="manage-groups"><img src="images/icons/address_16.png" border="0"/></a>
					Группа:
				    </td>
				    <td colspan="3">
					<select name="group" id="select-group">
					<?php $_from = $this->_tpl_vars['groups']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['group']):
?>
					    <option value="<?php echo $this->_tpl_vars['group']['id']; ?>
" <?php if ($this->_tpl_vars['customer']['group_id'] == $this->_tpl_vars['group']['id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['group']['group_name']; ?>
</option>
					<?php endforeach; endif; unset($_from); ?>
					</select>
				    </td>
				</tr>
				<?php endif; ?>
				<?php if ($this->_tpl_vars['statuses'] != ''): ?>
				<tr>
				    <td align="right">
					<a href="javascript:void(0)" id="manage-statuses"><img src="images/icons/address_16.png" border="0"/></a>
					Статус:
				    </td>
				    <td colspan="3">
					<select name="status" id="select-status">
					<?php $_from = $this->_tpl_vars['statuses']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }if (count($_from)):
    foreach ($_from as $this->_tpl_vars['status']):
?>
					    <option value="<?php echo $this->_tpl_vars['status']['id']; ?>
" <?php if ($this->_tpl_vars['customer']['status_id'] == $this->_tpl_vars['status']['id']): ?>selected<?php endif; ?>><?php echo $this->_tpl_vars['status']['status_name']; ?>
</option>
					<?php endforeach; endif; unset($_from); ?>
					</select>
				    </td>
				</tr>
				<?php endif; ?>
			    </table>
			    <?php if ($this->_tpl_vars['customer'] != ''): ?>
			    <hr/>
			    Обращения по телефону:
			    <table class="ui-widget ui-corner-top" width="100%" cellspacing="0" rules="all" style="border: solid 1px #000000;">
				<thead class="ui-widget-header">
				    <tr>
					<th width="15%">Дата</th>
					<th width="20%">Направление звонка</th>
					<th>Примечание</th>
				    </tr>
				</thead>
				<tbody class="ui-widget-content">
				<?php $_from = $this->_tpl_vars['treatments']; if (!is_array($_from) && !is_object($_from)) { settype($_from, 'array'); }$this->_foreach['treatments'] = array('total' => count($_from), 'iteration' => 0);
if ($this->_foreach['treatments']['total'] > 0):
    foreach ($_from as $this->_tpl_vars['treatment']):
        $this->_foreach['treatments']['iteration']++;
?>
				    <tr <?php if ($this->_tpl_vars['treatment']['close'] == 1): ?>class="ui-state-disabled task-row"<?php elseif ($this->_tpl_vars['treatment']['this_is_task'] == 1): ?>class="ui-state-active task-row"<?php else: ?><?php if ($this->_tpl_vars['treatment']['direction'] == 'incomming'): ?>bgcolor="#f0f0ff"<?php endif; ?><?php endif; ?>>
					<td><span style="display: none;"><?php echo $this->_tpl_vars['treatment']['id']; ?>
</span><?php echo ((is_array($_tmp=$this->_tpl_vars['treatment']['date_time'])) ? $this->_run_mod_handler('date_format', true, $_tmp, '%d.%m.%Y, %H:%M') : smarty_modifier_date_format($_tmp, '%d.%m.%Y, %H:%M')); ?>
</td>
					<?php if ($this->_tpl_vars['treatment']['this_is_task'] == 1): ?>
					<td><a href="task.php?id=<?php echo $this->_tpl_vars['treatment']['id']; ?>
"><strong>Задача #<?php echo $this->_tpl_vars['treatment']['id']; ?>
</strong></a></td>
					<?php else: ?>
					<td><?php if ($this->_tpl_vars['treatment']['direction'] == 'incomming'): ?>Входящее<?php elseif ($this->_tpl_vars['treatment']['direction'] == 'outgoing'): ?>Исходящее<?php else: ?>&mdash;<?php endif; ?></td>
					<?php endif; ?>
					<td><?php echo ((is_array($_tmp=$this->_tpl_vars['treatment']['note'])) ? $this->_run_mod_handler('sslash', true, $_tmp) : stripslashes($_tmp)); ?>
</td>
				    </tr>
				<?php endforeach; else: ?>
				    <tr><td colspan="3" align="center">Обращений не найдено</td></tr>
				<?php endif; unset($_from); ?>
				</tbody>
			    </table>
			    <br/>
			    <a href="javascript:void(0)" id="treatment-add"><img src="images/icons/plus_16.png" border="0"/>&nbsp;Создать обращение</a>
			    <?php endif; ?>
			</div>
<!-- ВКЛАДКА Реквизиты -->
			<div id="bank">
			    <table width="100%">
				<tr>
				    <th colspan="2">Юридический адрес</th>
				</tr>
				<tr>
				    <td align="right">Регион:</td>
				    <td><input type="text" name="legal_region" id="legal-region" value="<?php echo $this->_tpl_vars['customer']['legal_region']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">Город:</td>
				    <td><input type="text" name="legal_city" id="legal-city" value="<?php echo $this->_tpl_vars['customer']['legal_city']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">Индекс:</td>
				    <td><input type="text" name="legal_index" id="legal-index" value="<?php echo $this->_tpl_vars['customer']['legal_index']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">Улица:</td>
				    <td><input type="text" name="legal_street" id="legal-street" value="<?php echo $this->_tpl_vars['customer']['legal_street']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">Дом:</td>
				    <td><input type="text" name="legal_home" id="legal-home" value="<?php echo $this->_tpl_vars['customer']['legal_home']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">Литера:</td>
				    <td><input type="text" name="legal_litera" id="legal-litera" value="<?php echo $this->_tpl_vars['customer']['legal_litera']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">Офис:</td>
				    <td><input type="text" name="legal_office" id="legal-office" value="<?php echo $this->_tpl_vars['customer']['legal_office']; ?>
"/></td>
				</tr>
				<tr>
				    <th colspan="2">Фактический адрес <input type="checkbox" id="match-jur"/><label for="match-jur">совпадает с юридическим</label></th>
				</tr>
				<tr class="address-actual">
				    <td align="right">Регион:</td>
				    <td><input type="text" name="actual_region" id="actual-region" value="<?php echo $this->_tpl_vars['customer']['actual_region']; ?>
"/></td>
				</tr>
				<tr class="address-actual">
				    <td align="right">Город:</td>
				    <td><input type="text" name="actual_city" id="actual-city" value="<?php echo $this->_tpl_vars['customer']['actual_city']; ?>
"/></td>
				</tr>
				<tr class="address-actual">
				    <td align="right">Индекс:</td>
				    <td><input type="text" name="actual_index" id="actual-index" value="<?php echo $this->_tpl_vars['customer']['actual_index']; ?>
"/></td>
				</tr>
				<tr class="address-actual">
				    <td align="right">Улица:</td>
				    <td><input type="text" name="actual_street" id="actual-street" value="<?php echo $this->_tpl_vars['customer']['actual_street']; ?>
"/></td>
				</tr>
				<tr class="address-actual">
				    <td align="right">Дом:</td>
				    <td><input type="text" name="actual_home" id="actual-home" value="<?php echo $this->_tpl_vars['customer']['actual_home']; ?>
"/></td>
				</tr>
				<tr class="address-actual">
				    <td align="right">Литера:</td>
				    <td><input type="text" name="actual_litera" id="actual-litera" value="<?php echo $this->_tpl_vars['customer']['actual_litera']; ?>
"/></td>
				</tr>
				<tr class="address-actual">
				    <td align="right">Офис:</td>
				    <td><input type="text" name="actual_office" id="actual-office" value="<?php echo $this->_tpl_vars['customer']['actual_office']; ?>
"/></td>
				</tr>
				<tr>
				    <th colspan="2">
					Почтовый адрес <input type="checkbox" id="match"/><label for="match">совпадает с</label>
					<select id="postal-match" style="display:none;">
					    <option value="0">-</option>
					    <option value="jur">юридическим</option>
					    <option value="act">фактическим</option>
					</select>
				    </th>
				</tr>
				<tr class="address-postal">
				    <td align="right">Регион:</td>
				    <td><input type="text" name="postal_region" id="postal-region" value="<?php echo $this->_tpl_vars['customer']['postal_region']; ?>
"/></td>
				</tr>
				<tr class="address-postal">
				    <td align="right">Город:</td>
				    <td><input type="text" name="postal_city" id="postal-city" value="<?php echo $this->_tpl_vars['customer']['postal_city']; ?>
"/></td>
				</tr>
				<tr class="address-postal">
				    <td align="right">Индекс:</td>
				    <td><input type="text" name="postal_index" id="postal-index" value="<?php echo $this->_tpl_vars['customer']['postal_index']; ?>
"/></td>
				</tr>
				<tr class="address-postal">
				    <td align="right">Улица:</td>
				    <td><input type="text" name="postal_street" id="postal-street" value="<?php echo $this->_tpl_vars['customer']['postal_street']; ?>
"/></td>
				</tr>
				<tr class="address-postal">
				    <td align="right">Дом:</td>
				    <td><input type="text" name="postal_home" id="postal-home" value="<?php echo $this->_tpl_vars['customer']['postal_home']; ?>
"/></td>
				</tr>
				<tr class="address-postal">
				    <td align="right">Литера:</td>
				    <td><input type="text" name="postal_litera" id="postal-litera" value="<?php echo $this->_tpl_vars['customer']['postal_litera']; ?>
"/></td>
				</tr>
				<tr class="address-postal">
				    <td align="right">Офис:</td>
				    <td><input type="text" name="postal_office" id="postal-office" value="<?php echo $this->_tpl_vars['customer']['postal_office']; ?>
"/></td>
				</tr>
				<tr>
				    <th colspan="2">Реквизиты</th>
				</tr>
				<tr>
				    <td align="right">ИНН:</td>
				    <td><input type="text" name="inn" id="bank-inn" value="<?php echo $this->_tpl_vars['customer']['inn']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">КПП:</td>
				    <td><input type="text" name="kpp" id="bank-kpp" value="<?php echo $this->_tpl_vars['customer']['kpp']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">ОКПО:</td>
				    <td><input type="text" name="okpo" id="bank-okpo" value="<?php echo $this->_tpl_vars['customer']['okpo']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">ОКОНХ:</td>
				    <td><input type="text" name="okonh" id="bank-okonh" value="<?php echo $this->_tpl_vars['customer']['okonh']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">БИК:</td>
				    <td><input type="text" name="bic" id="bank-bic" value="<?php echo $this->_tpl_vars['customer']['bik']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">БАНК:</td>
				    <td><input type="text" name="bank_name" id="bank-name" value="<?php echo ((is_array($_tmp=((is_array($_tmp=$this->_tpl_vars['customer']['bank'])) ? $this->_run_mod_handler('sslash', true, $_tmp) : stripslashes($_tmp)))) ? $this->_run_mod_handler('escape', true, $_tmp) : smarty_modifier_escape($_tmp)); ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">Р/С:</td>
				    <td><input type="text" name="account_r" id="bank-account-r" value="<?php echo $this->_tpl_vars['customer']['current_account']; ?>
"/></td>
				</tr>
				<tr>
				    <td align="right">К/С:</td>
				    <td><input type="text" name="account_k" id="bank-account-k" value="<?php echo $this->_tpl_vars['customer']['korr_account']; ?>
"/></td>
				</tr>
			    </table>
			    </form>
			</div>
			<?php if ($this->_tpl_vars['customer'] != ''): ?>

<!-- ВКЛАДКА Услуги -->
			<div id="services">
			<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/submodules/services.tab.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			</div>

<!-- ВКЛАДКА Контакты -->
			<div id="contact">
			<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/submodules/contacts.tab.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			</div>
			<?php endif; ?>

			<?php if ($this->_tpl_vars['customer'] != ''): ?>
<!-- ВКЛАДКА Документы -->
			<div id="document">
			<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/submodules/documents.tab.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			</div>

<!-- ВКЛАДКА Счета -->
			<div id="invoice">
			<?php $_smarty_tpl_vars = $this->_tpl_vars;
$this->_smarty_include(array('smarty_include_tpl_file' => "admin/submodules/invoices.tab.html", 'smarty_include_vars' => array()));
$this->_tpl_vars = $_smarty_tpl_vars;
unset($_smarty_tpl_vars);
 ?>
			</div>
			<?php endif; ?>
		    </div>
		</td>
	    </tr>
	</table>
    </body>
</html>